<template>
    <div class="song-list-wrapper" @click="handleClick">
        <div class="song--list-cover">
            <img :src="item.coverImgUrl + '?imageView&thumbnail=120y120&quality=60&tostatic=0'" />
        </div>
        <p class="song-list-name">{{item.name}}</p>
        
    </div>
</template>

<script>
export default {
    props: {
        data:{
            type: Object
        }
    },
    computed: {
        item(){
            return this.data;
        }
    },
    methods: {
        handleClick(e){
            this.$emit('detail-click', this.data, e)
        }
    }
}
</script>

<style lang="scss" scoped>
     @import '@/assets/styles/global';

    .song-list-wrapper {
        border-radius: px2rem(4);
        border: px2rem(1) solid #f1eeee;
        box-shadow: 0 px2rem(2) px2rem(4) #ccc;
        margin: px2rem(4);
        position: relative;
        background: #fff;
        .song--list-cover {
            border-radius: px2rem(4);
            overflow: hidden;
            height: 70%;
            img {
                width: 100%;
                height: 100%;
            }
        }

        .song-list-name {
            @include defaultSubTitle;
            @include ellipsis2(2);
            line-height: px2rem(20);
            height: px2rem(40);
            padding: 0 px2rem(4);
        }

        // .song-list-tag {
        //     border-radius: px2rem(2);
        //     border: 1px solid #ccc;
        //     padding: px2rem(4) px2rem(6);
        //     margin: px2rem(4) px2rem(6);
        // }
        &::after {
            content: '';
            position: absolute;
            z-index: -1;
            width: px2rem(100);
            height: px2rem(100);
            border-radius: 50%;
            background: #555;
            right: -12%;
            top: px2rem(10);
        }
    }
</style>